/*
 * @Author: yeminglong
 * @Date: 2024-04-28 09:47:02
 * @LastEditTime: 2024-04-28 09:53:42
 * @LastEditors: yeminglong
 * @Description: 系统登陆
 */
import service from '@/utils/request.js'
export default class AuthServiceApi {
  /**
   * 获取验证码
   * @returns {Promise<unknown>}
   */
  static getCaptchaCode(params = {}) {
    return service({
      url: `/environment-monitor/admin/auth/getCaptchaCode`,
      method: 'GET',
      params: params
    })
  }

  /**
   * 登陆获取Token
   * @param {String} ld.code -  验证码
   * @param {String} ld.password -  密码
   * @param {String} ld.username -  账号
   * @param {String} ld.uuid -  验证码唯一标识
   * @returns {Promise<unknown>}
   */
  static getToken(params = {}) {
    return service({
      url: `/environment-monitor/admin/auth/getToken`,
      method: 'POST',
      data: JSON.stringify(params || {}),
      headers: {
        'Content-Type': 'application/json'
      },
      transformRequest: null
    })
  }
}
